﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZetaPrints.ZetaClient.Shared.Manipulator
{
    public static class OrderStatusManipulator
    {
        /// <summary>
        /// From a command string we transform to a language string
        /// </summary>
        /// <param name="commandString"></param>
        /// <returns></returns>
        public static string FromCommandToLang(string commandString)
        {
            string langString = commandString;

            switch (commandString)
            {
                case "cancelled":
                    langString = Lang.OrderStatusCancelled;
                    break;
                case "deleted":
                    langString = Lang.OrderStatusDeleted;
                    break;
                case "download":
                    langString = Lang.OrderStatusDownload;
                    break;
                case "drafts":
                    langString = Lang.OrderStatusDrafts;
                    break;
                case"in print":
                    langString = Lang.OrderStatusInPrint;
                    break;
                case "printed":
                    langString = Lang.OrderStatusPrinted;
                    break;
                case "problems":
                    langString = Lang.OrderStatusProblems;
                    break;
                case "quote":
                    langString = Lang.OrderStatusQuote;
                    break;
                case "saved":
                    langString = Lang.OrderStatusSaved;
                    break;
                case "shipped":
                    langString = Lang.OrderStatusShipped;
                    break;
                case "test":
                    langString = Lang.OrderStatusTest;
                    break;
                case "to approve":
                    langString = Lang.OrderStatusToApprove;
                    break;
                case "to print":
                    langString = Lang.OrderStatusToPrint;
                    break;
                case "unpaid":
                    langString = Lang.OrderStatusUnpaid;
                    break;
            }

            return langString;
        }
        /// <summary>
        /// This will go from a language string to a specific command
        /// unmutable string. This is so we can support multiple languages
        /// </summary>
        /// <param name="languageString"></param>
        /// <returns></returns>
        public static string FromLangToCommand(string languageString)
        {
            string commandString = string.Empty;

            if( languageString == Lang.OrderStatusCancelled )
            {
                commandString = "cancelled";
            }
            else if (languageString == Lang.OrderStatusDeleted)
            {
                commandString = "deleted";
            }
            else if (languageString == Lang.OrderStatusDownload)
            {
                commandString = "download";
            }
            else if (languageString == Lang.OrderStatusDrafts)
            {
                commandString = "drafts";
            }
            else if (languageString == Lang.OrderStatusInPrint)
            {
                commandString = "in print";
            }
            else if (languageString == Lang.OrderStatusPrinted)
            {
                commandString = "printed";
            }
            else if (languageString == Lang.OrderStatusProblems)
            {
                commandString = "problems";
            }
            else if (languageString == Lang.OrderStatusQuote)
            {
                commandString = "quote";
            }
            else if (languageString == Lang.OrderStatusSaved)
            {
                commandString = "saved";
            }
            else if (languageString == Lang.OrderStatusShipped)
            {
                commandString = "shipped";
            }
            else if (languageString == Lang.OrderStatusTest)
            {
                commandString = "test";
            }
            else if (languageString == Lang.OrderStatusToApprove)
            {
                commandString = "to approve";
            }
            else if (languageString == Lang.OrderStatusToPrint)
            {
                commandString = "to print";
            }
            else if (languageString == Lang.OrderStatusUnpaid)
            {
                commandString = "unpaid";
            }

            return commandString;
        }
    }
}
